<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWeappTokenTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('weapp_token', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->string('token')->unique()->comment('令牌值');

            $table->integer('user_id')->unsigned()->comment('用户id');

            $table->integer('expire_time')->unsigned()->comment('过期时间');

            $table->integer('type')->unsigned()->comment('类型,1是微信小程序,2是h5');


        });

        DB::statement("ALTER TABLE `weapp_token` COMMENT='前台用户token表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('weapp_token');
    }
}
